package com.cntaiping.ttnews.adapter;

import android.provider.MediaStore;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.security.PrivateKey;
import java.util.AbstractMap;
import java.util.List;

/**
 * Created by Administrator on 2016/7/21.
 */
public class VpAdapter extends FragmentPagerAdapter {
    private List<Fragment> mList;
    private String[] mTitle = {"快报","视频","直播","娱乐" ,"社会"};
    public VpAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.mList = list;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList == null ? 0 : mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitle[position];
    }
}
